#include <stdio.h>
#include <signal.h>
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>

int main()
{
    sigset_t set, oldset;
    sigemptyset(&set);
    sigaddset(&set, SIGINT);
    sigaddset(&set, SIGRTMIN+6);
    sigprocmask(SIG_BLOCK, &set, &oldset);
    for (int i = 0; i < 5; ++i)
    {
        printf("2号信号: %d\n",i);
        kill(getpid(), SIGINT);
        
    }

    for (int i = 0; i < 5; ++i)
    {
        kill(getpid(), 40);
        printf("40号信号: %d\n",i);
    }

    printf("正常结束\n");
    return 0;
}